From f49f9b4114d59a67b53322f3f6148ed0db497dca Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 26 Nov 2014 16:17:49 +0000 Subject: [PATCH] libxl: events: Assert that libxl_ctx_free is not called from a hook No-one in their right mind would do this, and if they did everything would definitely collapse. Arrange that if this happens, we crash ASAP. Signed-off-by: Ian Jackson Acked-by: Ian Campbell Tested-by: Ian Campbell Release-Acked-by: Konrad Rzeszutek Wilk --- tools/libxl/libxl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 74c00dc414..55ef5357b0 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -148,6 +148,8 @@ int libxl_ctx_free(libxl_ctx *ctx) { if (!ctx) return 0; + assert(!ctx->osevent_in_hook); + int i; GC_INIT(ctx); -- 2.30.2